package com.bilibili.feignClient;

import com.bilibili.domain.User;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

@Component  //很容易忘记，要注意
public class UserFeignClientFallbackFactory implements FallbackFactory<UserFeignClient> {
    @Override
    public UserFeignClient create(Throwable throwable) {
        return new UserFeignClient() {


            @Override
            public User findById(Long id) {
                return new User(-2L,"pay调用异常","user的用户服务挂起了");
            }
        };
    }
}
